using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Dal.Entities;

namespace Dal.Mapping
{
	public class Doc0Map : EntityTypeConfiguration<Doc0>
	{
		public Doc0Map()
		{
			// Primary Key
			this.HasKey(t => t.DocID);

			// Properties
			this.Property(t => t.DocID)
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
				
			this.Property(t => t.PatientName)
				.HasMaxLength(50);
				
			this.Property(t => t.PatientSex)
				.HasMaxLength(50);
				
			this.Property(t => t.PatientJob)
				.HasMaxLength(50);
				
			this.Property(t => t.PatientTel)
				.HasMaxLength(50);
				
			this.Property(t => t.PatientAddress)
				.HasMaxLength(150);
				
			// Table & Column Mappings
			this.ToTable("Doc0");
			this.Property(t => t.DocID).HasColumnName("DocID");
			this.Property(t => t.InputTime).HasColumnName("InputTime");
			this.Property(t => t.PatientName).HasColumnName("PatientName");
			this.Property(t => t.PatientAge).HasColumnName("PatientAge");
			this.Property(t => t.PatientSex).HasColumnName("PatientSex");
			this.Property(t => t.PatientJob).HasColumnName("PatientJob");
			this.Property(t => t.PatientTel).HasColumnName("PatientTel");
			this.Property(t => t.PatientAddress).HasColumnName("PatientAddress");
			this.Property(t => t.StatusAudit).HasColumnName("StatusAudit");
			this.Property(t => t.StatusComplete).HasColumnName("StatusComplete");
		}
	}
}

